package cn.wolfcode.wolf2w.service.impl;

import cn.wolfcode.wolf2w.domain.HotDest;


import cn.wolfcode.wolf2w.repository.HotDestRepository;
import cn.wolfcode.wolf2w.service.IHotDestService;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;



import java.util.List;


@Service
public class HotDestServiceImpl implements IHotDestService {


    @Autowired
    private HotDestRepository hotDestRepository;


    @Override
    public void save(HotDest hotDest) {
        hotDest.setId(null);
        hotDestRepository.save(hotDest);
    }

    @Override
    public void update(HotDest hotDest) {
        hotDestRepository.save(hotDest);
    }

    @Override
    public void delete(String id) {
        hotDestRepository.deleteById(id);
    }

    @Override
    public HotDest get(String id) {
        return hotDestRepository.findById(id).orElse(null);
    }

    @Override
    public List<HotDest> list() {
        return hotDestRepository.findAll();
    }
    


}
